require 'fileutils'
require 'rubygems'
require 'ostruct'
require 'rake'

class String
  def underscore
    word = self.dup
    word.gsub!(/::/, '/')
    word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
    word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
    word.tr!("-", "_")
    word.downcase!
    word
  end
end

class Object
  def blank?
    respond_to?(:empty?) ? empty? : !self
  end
end

require File.dirname(__FILE__) + '/lib/tm'
require File.dirname(__FILE__) + '/lib/misc'

require "#{TM.support_path}/lib/escape"
require "#{TM.support_path}/lib/textmate"
require "#{TM.support_path}/lib/ui"
require "#{TM.support_path}/lib/exit_codes"

require_all File.join(File.dirname(__FILE__) + '/models')

EVIL_ROOT = File.expand_path(File.dirname(__FILE__))